/**
 * 
 */
package com.lmqb.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lmqb.bean.ShowImage;
import com.lmqb.dao.ShowImageMapper;
import com.lmqb.page.PageTool;
import com.lmqb.page.ShowImagePager;
import com.lmqb.service.ShowImageService;

/** 
 * @author 作者 : hucong
 * @version 创建时间：2017年9月19日 上午10:45:39 
 * 类说明 
 */
/**
 * @author Administrator
 *
 */

@Service("showImageService")
public class ShowImageServiceImpl implements ShowImageService{
	
	@Autowired
	private ShowImageMapper showImageMapper;

	/* (non-Javadoc)
	 * @see com.lmqb.service.ShowImageService#insertSelective(com.lmqb.bean.ShowImage)
	 */
	public int insertSelective(ShowImage showImage) {
		
		return showImageMapper.insertSelective(showImage);
	}

	/* (non-Javadoc)
	 * @see com.lmqb.service.ShowImageService#selectAll(com.lmqb.page.ShowImagePager)
	 */
	@Override
	public ShowImagePager selectAll(ShowImagePager pagerModel) {
		List<ShowImage> list = showImageMapper.selectAll(pagerModel);
		pagerModel.setList(list);
		int count = showImageMapper.selectCount(pagerModel);
		pagerModel.setTotalRow(count);
		int totalPage = PageTool.getTotalPage(count, pagerModel.getPageSize());
		pagerModel.setTotalPage(totalPage);
		return pagerModel;
	}

	/* (non-Javadoc)
	 * @see com.lmqb.service.ShowImageService#updateByPrimaryKeySelective(com.lmqb.bean.ShowImage)
	 */
	
	public int updateByPrimaryKeySelective(ShowImage showImage) {
		
		return showImageMapper.updateByPrimaryKeySelective(showImage);
	}

	/* (non-Javadoc)
	 * @see com.lmqb.service.ShowImageService#selectBytradId(java.lang.Integer)
	 */
	
	public ShowImage selectBytradId(Integer tradId) {
		ShowImage showImage = showImageMapper.selectBytradId(tradId);
		return showImage;
	}

	/* (non-Javadoc)
	 * @see com.lmqb.service.ShowImageService#deleteDateShowImage(java.lang.Integer)
	 */
	@Override
	public int deleteDateShowImage(Integer tradId) {
		
		return showImageMapper.deleteDateShowImage(tradId);
	}


}
